
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[usp_ShowRecruitParticipantsIDCompany]
	
	(
	@param_type NVARCHAR(50),
	@param_UserID NVARCHAR(50)

	)
	
AS
	/* SET NOCOUNT ON */
	IF @param_type='school'
	BEGIN
	 SET @param_type='校内专场'
	 END
	 ELSE
	 BEGIN
	 IF @param_type='web'
	 BEGIN
	  SET @param_type='网络招聘会'
	 END
	 END
	
	SELECT dbo.JOL_Recruitment_Participants_apply.id 
	FROM dbo.JOL_Recruitment_Participants_apply,dbo.JOL_Recruitment,dbo.JOL_Employer 
	WHERE  recruitment=dbo.JOL_Recruitment.id AND employing_unit=JOL_Employer_No AND type=@param_type AND JOL_Employer_Account=@param_UserID
	ORDER BY dbo.JOL_Recruitment_Participants_apply.update_time,dbo.JOL_Recruitment_Participants_apply.add_time DESC 
	
	RETURN
GO
